package com.pdsu.alumni.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.pdsu.alumni.common.result.Result;
import com.pdsu.alumni.pojo.CommonUser;
import com.pdsu.alumni.pojo.Faculty;
import com.pdsu.alumni.service.IFacultyService;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author Acerola
 * @since 2021-11-09
 */
@RestController
@RequestMapping("/faculty")
public class FacultyController {
    @Autowired
    private IFacultyService facultyService;

    @ApiOperation(value = "获取所有院系")
    @GetMapping("/list")
    @RequiresAuthentication
    //@RequiresPermissions("")
    @ResponseBody
    @CrossOrigin
    public Result getAllFaculty() {
        List<Faculty> list = facultyService.list(null);
        return new Result().success().put(list);
    }


}
